﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" language="java"%>
<%@ page import="net.sf.json.JSONArray" language="java"%>
<%@ page import="westh.ilib.bean.croDomainSearch.Resource" language="java"%>

<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<base href="${AppURL}/ilib/" />
<TITLE>iLib</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<LINK rel=stylesheet type=text/css href="ilib/style/main.css">
</HEAD>

<jsp:useBean id="pageInfo" scope="request" class="westh.ilib.util.PageInfo" />

<BODY>
<DIV id="container">
	<%@ include file="../share/header.jsp" %>


	<div id="clear"></div>   

	<form name="testForm" action="http://localhost:4180/ilib/getQueryResult.do" method="post" onsubmit="return validate_form(this)" >
	<%@ include file="../JSP/pageTop.jsp"%>

	<%
		JSONArray typeList=JSONArray.fromObject(request.getAttribute("rscTypeList"));
		JSONArray fieldList=JSONArray.fromObject(request.getAttribute("rscFieldList"));	
	%> 
	
	选择类型:
	<input type="checkbox" name="type" size="20" value="1"  <%if(typeList.contains(String.valueOf("1"))) out.println("checked");%> /> 图书
	<input type="checkbox" name="type" size="20" value="2"  <%if(typeList.contains(String.valueOf("2"))) out.println("checked");%> /> 会议论文
	<input type="checkbox" name="type" size="20" value="3"  <%if(typeList.contains(String.valueOf("3"))) out.println("checked"); %> /> 期刊论文
	<input type="checkbox" name="type" size="20" value="4" <%if(typeList.contains(String.valueOf("4"))) out.println("checked"); %> /> 专利
	<input type="checkbox" name="type" size="20" value="5"  <%if(typeList.contains(String.valueOf("5"))) out.println("checked"); %> /> 标准
	<input type="checkbox" name="type" size="20" value="6" <%if(typeList.contains(String.valueOf("6"))) out.println("checked"); %> />软著
	<input type="checkbox" name="type" size="20" value="7"  <%if(typeList.contains(String.valueOf("7"))) out.println("checked"); %> />技术报告

	<br/>
	
	关键词:

	<%
		String inputStr=(String)request.getAttribute("inputStr"); 
	%>

	<input type="text" name="inputStr" size="60" dataType="Require" value="${inputStr}" />
 	<input type="submit" value="搜索"/>   
 	<name="Submit" onClick="javascript:history.go(-1)"> 
	<br/>
	选择域:
	<input type="checkbox" name="field" size="20" value="1"  <%if(fieldList.contains(String.valueOf("1"))) out.println("checked");%> /> 国家图书馆 
	<input type="checkbox" name="field" size="20" value="2"  <%if(fieldList.contains(String.valueOf("2"))) out.println("checked");%> /> 清华大学图书馆(OAI)
	<input type="checkbox" name="field" size="20" value="3"  <%if(fieldList.contains(String.valueOf("3"))) out.println("checked"); %> /> CALIS
	<input type="checkbox" name="field" size="20" value="4"  <%if(fieldList.contains(String.valueOf("4"))) out.println("checked"); %> /> 清华大学水利
	<input type="checkbox" name="field" size="20" value="5"  <%if(fieldList.contains(String.valueOf("5"))) out.println("checked"); %> /> TagSys
	<br/>
	
	
	<DIV id="left">
	<H3>跨域检索结果：</H3>


	<DIV id="lblock0">
		<TABLE width="900" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
			<TBODY>
				<TR>
					<TD align="center" width="35"><B>序号</B></TD>
					<TD align="center" width="465"><B>文章名称</B></TD>
					<TD align="center" width="95"><B>类别</B></TD>
					<TD align="center" width="89"><B>出版日期</B></TD>
					<TD width="84" align="center"><B>作者</B></TD>
					<TD width="106" align="center"><B>来源域</B></TD>
				</TR>
	     		<%
	     	  		List<Resource> list = pageInfo.getPageList();
	     	  		Iterator iterator = list.iterator();
	     	  		Resource rsc=null;
	     	  		int iNo=1;
	     	  		while(iterator.hasNext())
	    	  		//for (int i = 0; i < list.size(); i++)
	    	  		{   
	    	  		 	if (iNo % 2 == 1)
	    	  				out.println("<tr height=\"30\" bgcolor=\"#E0E0F8\">");
	    	  			else
	    	  				out.println("<TR height=\"30\">");
	    	  	  		rsc=(Resource)iterator.next();
	    	  	  
	    		  		//序号
	    		  		out.println("<TD align=\"center\">");
	    		  		out.println((iNo + (pageInfo.getPageNO() -1) * pageInfo.getPageSize()));
	    		  		out.println("</td>");
                        
                        //标题
                        out.println("<TD id=\"title\" align=\"center\">");
                        out.println("<A href=\"../rscInfo.do?rscId=" + rsc.getRscId() + "\">"  + rsc.getRscTitle() + "</a>");
						out.println("</td>");
                          
                        //类别
                        out.println("<TD id=\"even\" align=\"center\">");
                    	int intType = rsc.getRscType();
        				switch(intType)
        				{
         					case 1:
         						out.println("图书");
         						break;
         					case 2:
        						out.println("会议论文");
        						break;
        					case 3:
        						out.println("期刊论文");
        						break;
        					case 4:
        						out.println("专利");
        						break;
        					case 5:
        						out.println("软著");
        						break;
        					case 6:
        						out.println("技术报告");
        						break;
        					case 7:
        						out.println("标准");
        						break;
        					default:
        						out.println("未知");
        				}
                        out.println("</td>");
                        
	    		  		//发表时间
	    		  		out.println("<TD id=\"even\" align=\"center\">");
	    		  		String dates=rsc.getRscPublishDate();
	    		  		String[] date=null;
	    		  		if(dates!=null||!dates.equals(""))	
	    		  			date=dates.split(";");
	    		  		out.println(date[date.length-1]);
	    		  		out.println("</td>");
	    		  		
	    		  		//作者
	    		  		out.println("<TD id=\"even\" align=\"center\">");
	    		  		
	    		  		if(rsc.getRscFirstAuthor()!=null){
	    		  			out.println("<A target=\"_blank\" href=\"../getResearcherInfo.do?researcherId=" + rsc.getRscFirstAuthor().getUid() + "\">"  +rsc.getRscFirstAuthor().getName() + "</a>");
	    		  		}
	    		  		out.println("</td>");
	    		  
	    		  		out.println("<TD id=\"even\" align=\"center\">");
	    		  		int intField = rsc.getRscField();
	    				switch(intField)
	    				{
	     					case 1:
	     						out.println("国图");
	     						break;
	     					case 2:
	    						out.println("清华大学图书馆(OAI)");
	    						break;
	    					case 3:
	    						out.println("CALIS");
	    						break;
	    					case 4:
	    						out.println("清华大学水利");
	    						break;
	    					case 5:
	    						out.println("TagSys");
	    						break;
	    					default:
	    						out.println("未知");
	    				}
	    		  		out.println("</td>");
	    		  
	    		  		out.println("</tr>");
	    		  		iNo++;
	    	  		}  	    	  
	      		%>   
	      	</TBODY>
		</TABLE>
		<br/>
      	<%@ include file="../JSP/pageBottom.jsp"%>
	</form>

    <a href="${redirect}"></a>

	<div id="footer">
		iLib 2010
	</div>	
<!-- end #container -->
</div>
</DIV>

</body>
</html>
